package game.entity;

import game.shared.Constants;

import java.util.ArrayList;

public class BufferSpriteManager {
	ArrayList<AbsSprite>listAbsSprite;
	SpriteManager armyManager;
	SpriteManager monterManager;
	SpriteManager weaponManager;
	
	public BufferSpriteManager(SpriteManager _ArmyManager, SpriteManager _MonsterManager, SpriteManager _WeaponManager) {
		armyManager = _ArmyManager;
		monterManager = _MonsterManager;
		weaponManager = _WeaponManager;
				
		listAbsSprite = new ArrayList<AbsSprite>();
		
		listAbsSprite.add(new Army(Constants.BUFFER_SPRITE_ARMY, weaponManager, "res/img/s1.txt"));
		listAbsSprite.add(new Monster(Constants.BUFFER_SPRITE_MONSTER, armyManager, "res/img/s1.txt"));
		listAbsSprite.add(new Weapon(Constants.BUFFER_SPRITE_WEAPON, weaponManager, "res/img/gun.txt"));
		listAbsSprite.add(new Army(Constants.BUFFER_SPRITE_ARMY_VISTA, armyManager, "res/img/windows_vista.txt"));
	}
	
	public AbsSprite getSpriteBufferByID(int id){
		for(int i=0; i<listAbsSprite.size(); i++)
			if(listAbsSprite.get(i).id == id)
				return listAbsSprite.get(i);
		return null;
	}
}
